﻿

#region Using directives

using System;
using System.Configuration.Provider;
using System.Collections.Specialized;
using System.Data;
using System.Data.Common;
using Indeco.G24.Entities;
using Indeco.G24.Data.Bases;

#endregion

namespace Indeco.G24.Data.WebServiceClient
{
	/// <summary>
	/// The WebService client data provider.
	/// </summary>
	public sealed class WsNetTiersProvider : Indeco.G24.Data.Bases.NetTiersProvider
	{
		private static object syncRoot = new Object();
		private string _applicationName;
		private string url;
        
		/// <summary>
		/// Initializes a new instance of the <see cref="WsNetTiersProvider"/> class.
		///</summary>
		public WsNetTiersProvider()
		{			
		}
		
		/// <summary>
        /// Initializes the provider.
        /// </summary>
        /// <param name="name">The friendly name of the provider.</param>
        /// <param name="config">A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.</param>
        /// <exception cref="T:System.ArgumentNullException">The name of the provider is null.</exception>
        /// <exception cref="T:System.InvalidOperationException">An attempt is made to call <see cref="M:System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection)"></see> on a provider after the provider has already been initialized.</exception>
        /// <exception cref="T:System.ArgumentException">The name of the provider has a length of zero.</exception>
		public override void Initialize(string name, NameValueCollection config)
        {
            // Verify that config isn't null
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            // Assign the provider a default name if it doesn't have one
            if (String.IsNullOrEmpty(name))
            {
                name = "SqlNetTiersProvider";
            }

            // Add a default "description" attribute to config if the
            // attribute doesn't exist or is empty
            if (string.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "NetTiers Sql provider");
            }

            // Call the base class's Initialize method
            base.Initialize(name, config);

            // Initialize _applicationName
            _applicationName = config["applicationName"];

            if (string.IsNullOrEmpty(_applicationName))
            {
                _applicationName = "/";
            }
            config.Remove("applicationName");


            #region Initialize Url
            string url  = config["url"];
           	if (string.IsNullOrEmpty(url))
            {
                throw new ProviderException("Empty or missing url");
            }
            this.url = url;
            config.Remove("url");
            #endregion

        }
        
		/// <summary>
		/// Current Url for WebService EndPoint
		/// </summary>
        public string Url
        {
        	get {return this.url;}
        	set {this.url = value;}
        }
		
		/// <summary>
		/// Creates a new <c cref="TransactionManager"/> instance from the current datasource.
		/// </summary>
		/// <returns></returns>
		public override TransactionManager CreateTransaction()
		{
			throw new NotSupportedException("Transactions are not supported by the webservice client.");
		}
		
		///<summary>
		/// Indicates if the current <c cref="NetTiersProvider"/> implementation supports Transacton.
		///</summary>
		public override bool IsTransactionSupported
		{
			get
			{
				return false;
			}
		}

			
		private WsNhaCungCapProvider innerNhaCungCapProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NhaCungCap"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NhaCungCapProviderBase NhaCungCapProvider
		{
			get
			{
				if (innerNhaCungCapProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNhaCungCapProvider == null)
						{
							this.innerNhaCungCapProvider = new WsNhaCungCapProvider(this.url);
						}
					}
				}
				return innerNhaCungCapProvider;
			}
		}
		
			
		private WsSanPhamBinhLuanProvider innerSanPhamBinhLuanProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SanPhamBinhLuan"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SanPhamBinhLuanProviderBase SanPhamBinhLuanProvider
		{
			get
			{
				if (innerSanPhamBinhLuanProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerSanPhamBinhLuanProvider == null)
						{
							this.innerSanPhamBinhLuanProvider = new WsSanPhamBinhLuanProvider(this.url);
						}
					}
				}
				return innerSanPhamBinhLuanProvider;
			}
		}
		
			
		private WsTinTucProvider innerTinTucProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TinTuc"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TinTucProviderBase TinTucProvider
		{
			get
			{
				if (innerTinTucProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTinTucProvider == null)
						{
							this.innerTinTucProvider = new WsTinTucProvider(this.url);
						}
					}
				}
				return innerTinTucProvider;
			}
		}
		
			
		private WsSanPhamDanhMucProvider innerSanPhamDanhMucProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SanPhamDanhMuc"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SanPhamDanhMucProviderBase SanPhamDanhMucProvider
		{
			get
			{
				if (innerSanPhamDanhMucProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerSanPhamDanhMucProvider == null)
						{
							this.innerSanPhamDanhMucProvider = new WsSanPhamDanhMucProvider(this.url);
						}
					}
				}
				return innerSanPhamDanhMucProvider;
			}
		}
		
			
		private WsSanPhamProvider innerSanPhamProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="SanPham"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override SanPhamProviderBase SanPhamProvider
		{
			get
			{
				if (innerSanPhamProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerSanPhamProvider == null)
						{
							this.innerSanPhamProvider = new WsSanPhamProvider(this.url);
						}
					}
				}
				return innerSanPhamProvider;
			}
		}
		
			
		private WsNhaCungCapSanPhamDanhMucProvider innerNhaCungCapSanPhamDanhMucProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NhaCungCapSanPhamDanhMuc"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NhaCungCapSanPhamDanhMucProviderBase NhaCungCapSanPhamDanhMucProvider
		{
			get
			{
				if (innerNhaCungCapSanPhamDanhMucProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNhaCungCapSanPhamDanhMucProvider == null)
						{
							this.innerNhaCungCapSanPhamDanhMucProvider = new WsNhaCungCapSanPhamDanhMucProvider(this.url);
						}
					}
				}
				return innerNhaCungCapSanPhamDanhMucProvider;
			}
		}
		
			
		private WsNhaSanXuatProvider innerNhaSanXuatProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NhaSanXuat"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NhaSanXuatProviderBase NhaSanXuatProvider
		{
			get
			{
				if (innerNhaSanXuatProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNhaSanXuatProvider == null)
						{
							this.innerNhaSanXuatProvider = new WsNhaSanXuatProvider(this.url);
						}
					}
				}
				return innerNhaSanXuatProvider;
			}
		}
		
			
		private WsQuanLyFileProvider innerQuanLyFileProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="QuanLyFile"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override QuanLyFileProviderBase QuanLyFileProvider
		{
			get
			{
				if (innerQuanLyFileProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerQuanLyFileProvider == null)
						{
							this.innerQuanLyFileProvider = new WsQuanLyFileProvider(this.url);
						}
					}
				}
				return innerQuanLyFileProvider;
			}
		}
		
			
		private WsTinTucBinhLuanProvider innerTinTucBinhLuanProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TinTucBinhLuan"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TinTucBinhLuanProviderBase TinTucBinhLuanProvider
		{
			get
			{
				if (innerTinTucBinhLuanProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTinTucBinhLuanProvider == null)
						{
							this.innerTinTucBinhLuanProvider = new WsTinTucBinhLuanProvider(this.url);
						}
					}
				}
				return innerTinTucBinhLuanProvider;
			}
		}
		
			
		private WsDiaBanProvider innerDiaBanProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="DiaBan"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DiaBanProviderBase DiaBanProvider
		{
			get
			{
				if (innerDiaBanProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDiaBanProvider == null)
						{
							this.innerDiaBanProvider = new WsDiaBanProvider(this.url);
						}
					}
				}
				return innerDiaBanProvider;
			}
		}
		
			
		private WsTinTucTheoChuDeProvider innerTinTucTheoChuDeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TinTucTheoChuDe"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TinTucTheoChuDeProviderBase TinTucTheoChuDeProvider
		{
			get
			{
				if (innerTinTucTheoChuDeProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTinTucTheoChuDeProvider == null)
						{
							this.innerTinTucTheoChuDeProvider = new WsTinTucTheoChuDeProvider(this.url);
						}
					}
				}
				return innerTinTucTheoChuDeProvider;
			}
		}
		
			
		private WsVaiTroProvider innerVaiTroProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="VaiTro"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override VaiTroProviderBase VaiTroProvider
		{
			get
			{
				if (innerVaiTroProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerVaiTroProvider == null)
						{
							this.innerVaiTroProvider = new WsVaiTroProvider(this.url);
						}
					}
				}
				return innerVaiTroProvider;
			}
		}
		
			
		private WsTinTucTieuDiemProvider innerTinTucTieuDiemProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TinTucTieuDiem"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TinTucTieuDiemProviderBase TinTucTieuDiemProvider
		{
			get
			{
				if (innerTinTucTieuDiemProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTinTucTieuDiemProvider == null)
						{
							this.innerTinTucTieuDiemProvider = new WsTinTucTieuDiemProvider(this.url);
						}
					}
				}
				return innerTinTucTieuDiemProvider;
			}
		}
		
			
		private WsTinTucDanhMucProvider innerTinTucDanhMucProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TinTucDanhMuc"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TinTucDanhMucProviderBase TinTucDanhMucProvider
		{
			get
			{
				if (innerTinTucDanhMucProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTinTucDanhMucProvider == null)
						{
							this.innerTinTucDanhMucProvider = new WsTinTucDanhMucProvider(this.url);
						}
					}
				}
				return innerTinTucDanhMucProvider;
			}
		}
		
			
		private WsNgoaiTeProvider innerNgoaiTeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NgoaiTe"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NgoaiTeProviderBase NgoaiTeProvider
		{
			get
			{
				if (innerNgoaiTeProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNgoaiTeProvider == null)
						{
							this.innerNgoaiTeProvider = new WsNgoaiTeProvider(this.url);
						}
					}
				}
				return innerNgoaiTeProvider;
			}
		}
		
			
		private WsTinTucChuDeProvider innerTinTucChuDeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TinTucChuDe"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TinTucChuDeProviderBase TinTucChuDeProvider
		{
			get
			{
				if (innerTinTucChuDeProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTinTucChuDeProvider == null)
						{
							this.innerTinTucChuDeProvider = new WsTinTucChuDeProvider(this.url);
						}
					}
				}
				return innerTinTucChuDeProvider;
			}
		}
		
			
		private WsTinTucSuKienProvider innerTinTucSuKienProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="TinTucSuKien"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override TinTucSuKienProviderBase TinTucSuKienProvider
		{
			get
			{
				if (innerTinTucSuKienProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerTinTucSuKienProvider == null)
						{
							this.innerTinTucSuKienProvider = new WsTinTucSuKienProvider(this.url);
						}
					}
				}
				return innerTinTucSuKienProvider;
			}
		}
		
			
		private WsNhaCungCapNganhNgheKinhDoanhProvider innerNhaCungCapNganhNgheKinhDoanhProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NhaCungCapNganhNgheKinhDoanh"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NhaCungCapNganhNgheKinhDoanhProviderBase NhaCungCapNganhNgheKinhDoanhProvider
		{
			get
			{
				if (innerNhaCungCapNganhNgheKinhDoanhProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNhaCungCapNganhNgheKinhDoanhProvider == null)
						{
							this.innerNhaCungCapNganhNgheKinhDoanhProvider = new WsNhaCungCapNganhNgheKinhDoanhProvider(this.url);
						}
					}
				}
				return innerNhaCungCapNganhNgheKinhDoanhProvider;
			}
		}
		
			
		private WsNganhNgheKinhDoanhProvider innerNganhNgheKinhDoanhProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NganhNgheKinhDoanh"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NganhNgheKinhDoanhProviderBase NganhNgheKinhDoanhProvider
		{
			get
			{
				if (innerNganhNgheKinhDoanhProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNganhNgheKinhDoanhProvider == null)
						{
							this.innerNganhNgheKinhDoanhProvider = new WsNganhNgheKinhDoanhProvider(this.url);
						}
					}
				}
				return innerNganhNgheKinhDoanhProvider;
			}
		}
		
			
		private WsNgheNghiepProvider innerNgheNghiepProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NgheNghiep"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NgheNghiepProviderBase NgheNghiepProvider
		{
			get
			{
				if (innerNgheNghiepProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNgheNghiepProvider == null)
						{
							this.innerNgheNghiepProvider = new WsNgheNghiepProvider(this.url);
						}
					}
				}
				return innerNgheNghiepProvider;
			}
		}
		
			
		private WsNguoiDungProvider innerNguoiDungProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NguoiDung"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NguoiDungProviderBase NguoiDungProvider
		{
			get
			{
				if (innerNguoiDungProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNguoiDungProvider == null)
						{
							this.innerNguoiDungProvider = new WsNguoiDungProvider(this.url);
						}
					}
				}
				return innerNguoiDungProvider;
			}
		}
		
			
		private WsLienHeProvider innerLienHeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="LienHe"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override LienHeProviderBase LienHeProvider
		{
			get
			{
				if (innerLienHeProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerLienHeProvider == null)
						{
							this.innerLienHeProvider = new WsLienHeProvider(this.url);
						}
					}
				}
				return innerLienHeProvider;
			}
		}
		
			
		private WsBangGiaSanPhamProvider innerBangGiaSanPhamProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="BangGiaSanPham"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override BangGiaSanPhamProviderBase BangGiaSanPhamProvider
		{
			get
			{
				if (innerBangGiaSanPhamProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerBangGiaSanPhamProvider == null)
						{
							this.innerBangGiaSanPhamProvider = new WsBangGiaSanPhamProvider(this.url);
						}
					}
				}
				return innerBangGiaSanPhamProvider;
			}
		}
		
			
		private WsCauHinhHeThongProvider innerCauHinhHeThongProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="CauHinhHeThong"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override CauHinhHeThongProviderBase CauHinhHeThongProvider
		{
			get
			{
				if (innerCauHinhHeThongProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerCauHinhHeThongProvider == null)
						{
							this.innerCauHinhHeThongProvider = new WsCauHinhHeThongProvider(this.url);
						}
					}
				}
				return innerCauHinhHeThongProvider;
			}
		}
		
			
		private WsDonViTinhProvider innerDonViTinhProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="DonViTinh"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override DonViTinhProviderBase DonViTinhProvider
		{
			get
			{
				if (innerDonViTinhProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerDonViTinhProvider == null)
						{
							this.innerDonViTinhProvider = new WsDonViTinhProvider(this.url);
						}
					}
				}
				return innerDonViTinhProvider;
			}
		}
		
			
		private WsNhaCungCapCauHinhProvider innerNhaCungCapCauHinhProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NhaCungCapCauHinh"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NhaCungCapCauHinhProviderBase NhaCungCapCauHinhProvider
		{
			get
			{
				if (innerNhaCungCapCauHinhProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNhaCungCapCauHinhProvider == null)
						{
							this.innerNhaCungCapCauHinhProvider = new WsNhaCungCapCauHinhProvider(this.url);
						}
					}
				}
				return innerNhaCungCapCauHinhProvider;
			}
		}
		
			
		private WsNhaCungCapDiaBanProvider innerNhaCungCapDiaBanProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NhaCungCapDiaBan"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NhaCungCapDiaBanProviderBase NhaCungCapDiaBanProvider
		{
			get
			{
				if (innerNhaCungCapDiaBanProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNhaCungCapDiaBanProvider == null)
						{
							this.innerNhaCungCapDiaBanProvider = new WsNhaCungCapDiaBanProvider(this.url);
						}
					}
				}
				return innerNhaCungCapDiaBanProvider;
			}
		}
		
			
		private WsNhaCungCapLienHeProvider innerNhaCungCapLienHeProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NhaCungCapLienHe"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NhaCungCapLienHeProviderBase NhaCungCapLienHeProvider
		{
			get
			{
				if (innerNhaCungCapLienHeProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNhaCungCapLienHeProvider == null)
						{
							this.innerNhaCungCapLienHeProvider = new WsNhaCungCapLienHeProvider(this.url);
						}
					}
				}
				return innerNhaCungCapLienHeProvider;
			}
		}
		
			
		private WsNguoiDungVaiTroProvider innerNguoiDungVaiTroProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NguoiDungVaiTro"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NguoiDungVaiTroProviderBase NguoiDungVaiTroProvider
		{
			get
			{
				if (innerNguoiDungVaiTroProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNguoiDungVaiTroProvider == null)
						{
							this.innerNguoiDungVaiTroProvider = new WsNguoiDungVaiTroProvider(this.url);
						}
					}
				}
				return innerNguoiDungVaiTroProvider;
			}
		}
		
			
		private WsNguoiDungDiaBanProvider innerNguoiDungDiaBanProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NguoiDungDiaBan"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NguoiDungDiaBanProviderBase NguoiDungDiaBanProvider
		{
			get
			{
				if (innerNguoiDungDiaBanProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNguoiDungDiaBanProvider == null)
						{
							this.innerNguoiDungDiaBanProvider = new WsNguoiDungDiaBanProvider(this.url);
						}
					}
				}
				return innerNguoiDungDiaBanProvider;
			}
		}
		
			
		private WsNguoiDungNgheNghiepProvider innerNguoiDungNgheNghiepProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NguoiDungNgheNghiep"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NguoiDungNgheNghiepProviderBase NguoiDungNgheNghiepProvider
		{
			get
			{
				if (innerNguoiDungNgheNghiepProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNguoiDungNgheNghiepProvider == null)
						{
							this.innerNguoiDungNgheNghiepProvider = new WsNguoiDungNgheNghiepProvider(this.url);
						}
					}
				}
				return innerNguoiDungNgheNghiepProvider;
			}
		}
		
			
		private WsNguoiDungNhaCungCapProvider innerNguoiDungNhaCungCapProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="NguoiDungNhaCungCap"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override NguoiDungNhaCungCapProviderBase NguoiDungNhaCungCapProvider
		{
			get
			{
				if (innerNguoiDungNhaCungCapProvider == null) 
				{
					lock (syncRoot)
					{
						if (innerNguoiDungNhaCungCapProvider == null)
						{
							this.innerNguoiDungNhaCungCapProvider = new WsNguoiDungNhaCungCapProvider(this.url);
						}
					}
				}
				return innerNguoiDungNhaCungCapProvider;
			}
		}
		
		
			
		private WsViewBangGiaSanPhamProvider innerViewBangGiaSanPhamProvider;

		///<summary>
		/// This class is the Data Access Logic Component for the <see cref="ViewBangGiaSanPham"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		/// <value></value>
		public override ViewBangGiaSanPhamProviderBase ViewBangGiaSanPhamProvider
		{
			get
			{
				if (innerViewBangGiaSanPhamProvider == null) 
				{
					lock (syncRoot) 
					{
						if (innerViewBangGiaSanPhamProvider == null)
						{
							this.innerViewBangGiaSanPhamProvider = new WsViewBangGiaSanPhamProvider(this.url);
						}
					}
				}
				return innerViewBangGiaSanPhamProvider;
			}
		}
		
		
		#region "General data access methods"

		#region "ExecuteNonQuery"
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.G24DATAServices proxy = new WsProxy.G24DATAServices();
			proxy.Url = this.url;
			return proxy.ExecuteNonQuery(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		public override void ExecuteNonQuery(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(CommandType commandType, string commandText)
		{
			WsProxy.G24DATAServices proxy = new WsProxy.G24DATAServices();
			proxy.Url = this.url;
			return proxy.ExecuteNonQuery((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);
		}
		/// <summary>
		/// Executes the non query.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override int ExecuteNonQuery(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}
		#endregion

		#region "ExecuteDataReader"
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(DbCommand commandWrapper)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(CommandType commandType, string commandText)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}
		/// <summary>
		/// Executes the reader.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override IDataReader ExecuteReader(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("ExecuteReader methods are not supported by the WebService provider.");
		}
		#endregion

		#region "ExecuteDataSet"
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.G24DATAServices proxy = new WsProxy.G24DATAServices();
			proxy.Url = this.url;
			return proxy.ExecuteDataSet(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}


		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(CommandType commandType, string commandText)
		{
			WsProxy.G24DATAServices proxy = new WsProxy.G24DATAServices();
			proxy.Url = this.url;
			return proxy.ExecuteDataSet((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);
		}
		
		/// <summary>
		/// Executes the data set.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override DataSet ExecuteDataSet(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");			
		}
		#endregion

		#region "ExecuteScalar"
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(string storedProcedureName, params object[] parameterValues)
		{
			WsProxy.G24DATAServices proxy = new WsProxy.G24DATAServices();
			proxy.Url = this.url;
			return proxy.ExecuteScalar(storedProcedureName, parameterValues);
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="storedProcedureName">Name of the stored procedure.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, string storedProcedureName, params object[] parameterValues)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandWrapper">The command wrapper.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, DbCommand commandWrapper)
		{
			throw new NotSupportedException("DBCommandWrapper overloads are not supported by the WebService provider.");
		}

		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(CommandType commandType, string commandText)
		{
			WsProxy.G24DATAServices proxy = new WsProxy.G24DATAServices();
			proxy.Url = this.url;
			return proxy.ExecuteScalar((WsProxy.CommandType)Enum.Parse(typeof(WsProxy.CommandType), commandType.ToString(), false), commandText);	
		}
		/// <summary>
		/// Executes the scalar.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="commandType">Type of the command.</param>
		/// <param name="commandText">The command text.</param>
		/// <returns></returns>
		public override object ExecuteScalar(TransactionManager transactionManager, CommandType commandType, string commandText)
		{
			throw new NotSupportedException("TransactionManager overloads are not supported by the WebService provider.");		
		}
		#endregion

		#endregion
	}
}
